package random.fox.p2p.ui;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.RelativeLayout;
import android.widget.TextView;
import android.widget.Toast;

import butterknife.ButterKnife;
import butterknife.OnClick;
import flow.Flow;
import random.fox.p2p.Paths;
import random.fox.p2p.R;
import random.fox.p2p.view.IExpandView;

/**
 * Created by delong on 2015/3/23.
 */
public class PersonalityView extends RelativeLayout implements IExpandView {

    public PersonalityView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onFinishInflate() {
        super.onFinishInflate();
        ButterKnife.inject(this);
    }

    @OnClick({R.id.personality_add, R.id.personality_expand_all})
    void textViewOnClicked(TextView textView) {
        Toast.makeText(getContext(), "textView:" + textView.getText(), Toast.LENGTH_SHORT).show();
        switch (textView.getId()) {
            case R.id.personality_add:
                break;
            case R.id.personality_expand_all:
                Flow.get(getContext()).set(new Paths.ExpandPersonalityPath());
                break;
        }
    }

    @Override
    public void entry(int index) {
        Toast.makeText(getContext(), "index:" + index, Toast.LENGTH_SHORT).show();
    }

    /**
     * 不需要实现
     */
    @Override
    public void expand() {

    }
}
